import PropTypes from 'prop-types'
import React, { memo } from 'react'
import { ListWrapper } from './style'
import RoomItem from '../room-item'

const RoomList = memo((props) => {
  const { list } = props
  return (
    <ListWrapper>
      {
        list?.map(item => {
          return <RoomItem key={item.id} data={item}></RoomItem>
        })
      }
    </ListWrapper>
  )
})

RoomList.propTypes = {
  list: PropTypes.array
}

export default RoomList